<template>
  <div>
    商品录入
    <el-button type="primary" @click="handleGoods">转存商品数据</el-button>
  </div>
</template>

<script>
  import axios from 'axios'
  import {goodsPost} from '@/api/stu'
  export default {
    methods: {
      handleGoods() {
        // let url = `https://m.wzj.com/proxy/search/products?module_id=1467&sub_navigation_id=296529&sort=popularity_desc&source_type=product&image_style=small&limit=20&offset=0`
        // let url= `/wzj/proxy/search/products?module_id=1541&sub_navigation_id=72360&sort=popularity_desc&source_type=product&image_style=small&limit=20&offset=0`
        // let url = `/wzj/proxy/search/products?module_id=1448&sub_navigation_id=66143&sort=popularity_desc&source_type=product&image_style=small&limit=20&offset=80`
        let url = `/wzj/proxy/search/products?module_id=1441&sub_navigation_id=66146&sort=popularity_desc&source_type=product&image_style=small&undefined=category_id&limit=60&offset=0`
        axios.get(url).then(res=>{ //请求别人的接口
          console.log(res);
          // 请求自己的后端
          goodsPost(res.data.results).then(res=>{
            console.log(res);
          })
        })
      }
    },
  }
</script>

<style lang="scss" scoped>

</style>